<?php

/*
 * Copyright 2008 the original author or authors.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#namespace tehframework\annotations;

class FakeAnnotation implements Annotation
{
	private $targets = Annotation::TARGET_ALL;
	
	private $multiple = false;
	
	protected $foo;
	
	public $bar;
	
	public $baz;
	
	public $wtf = 'rudoin';
	
	public function __construct($foo = null)
	{
		$this->foo = $foo;
	}
	
	public function getFoo()
	{
		return $this->foo;
	}
	
	public function setBaz($baz)
	{
		$this->baz = $baz;
	}
	
	public function setAnnotationTargets($targets)
	{
		$this->targets = $targets;
		
		return $this;
	}
	
	public function getAnnotationTargets()
	{
		return $this->targets;
	}
	
	public function allowMultiple()
	{
		$this->multiple = true;
		
		return $this;
	}
	
	public function disallowMultiple()
	{
		$this->multiple = false;
		
		return $this;
	}
	
	public function allowsMultiple()
	{
		return $this->multiple;
	}
	
	public function serialize()
	{
		return serialize(array(
			$this->targets, $this->multiple, $this->foo, $this->bar, $this->baz));
	}
	
	public function unserialize($serialized)
	{
		$unserialized = unserialize($serialized);
		
		$this->targets  = $unserialized[0];
		$this->multiple = $unserialized[1];
		$this->foo      = $unserialized[2];
		$this->bar      = $unserialized[2];
		$this->baz      = $unserialized[2];
	}
}